<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0"><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />   
        <title>Welcome to Design Zone......</title>
        <link rel="stylesheet" type="text/css" href="../../scripts/ext/resources/css/ext-all.css" />
        <link rel="stylesheet" type="text/css" href="../../styles/dzbase.css" />
        <script type="text/javascript" src="../../scripts/ext/adapter/ext-base.js">
        </script>
        <script type="text/javascript" src="../../scripts/ext/ext-all.js">
        </script>
        <script type="text/javascript" src="../../scripts/i18nMessage.js">
        </script>
        <script type="text/javascript" src="../../scripts/utils.js">
        </script>
        <script type="text/javascript">
        	var fcMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.francecustomer');
            var message = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=message');
			var ctYesnoXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtYesno');
			var ctYesnoStore;
			
			ctYesnoStore = new Ext.data.Store({
                reader: new Ext.data.XmlReader({
                    // records will have an "Item" tag
                    record: 'item',
                    id: 'code',
                    totalRecords: 'itemTotal'
                }, [ 
                'code', 'description']),
				data: ctYesnoXmlLoader.getXml()
            });
			
			var isPrDiscountCombo;
			var isProductionAdvancePaymentCombo;
			var isProductionGoodsDepartureCombo;
			var isProductionLcPaymentCombo;
			var isProductionDiscountCombo;
			
			var copyContact = function(target){
				Ext.getCmp(target + 'Contact').setValue(Ext.getCmp('rehearsalsContact').getValue());
				Ext.getCmp(target + 'Phone').setValue(Ext.getCmp('rehearsalsPhone').getValue());
				Ext.getCmp(target + 'Email').setValue(Ext.getCmp('rehearsalsEmail').getValue());
				Ext.getCmp(target + 'Fax').setValue(Ext.getCmp('rehearsalsFax').getValue());
				Ext.getCmp(target + 'Mobile').setValue(Ext.getCmp('rehearsalsMobile').getValue());
			}
			
            Ext.onReady(function(){
                Ext.QuickTips.init();
                Ext.form.Field.prototype.msgTarget = 'side';
				
				isPrDiscountCombo = new Ext.form.ComboBox({
					fieldLabel: '&nbsp;&nbsp;&nbsp;&nbsp;'+ fcMessage.get('ui.francecustomer.discount'),
					id: 'isPrDiscount',
					name: 'isPrDiscount',
					allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
					editable: false,
				    store: ctYesnoStore,
					valueField: 'code',
				    displayField:'description',
				    triggerAction: 'all',
				    emptyText: message.get('message.combo.pleaseselect'),
				    selectOnFocus:true,
					mode: 'local'
				});
				
				isProductionAdvancePaymentCombo = new Ext.form.ComboBox({
					fieldLabel: '&nbsp;&nbsp;&nbsp;&nbsp;'+ fcMessage.get('ui.francecustomer.advancepayment'),
					id: 'isProductionAdvancePayment',
					name: 'isProductionAdvancePayment',
					allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
					editable: false,
				    store: ctYesnoStore,
					valueField: 'code',
				    displayField:'description',
				    triggerAction: 'all',
				    emptyText: message.get('message.combo.pleaseselect'),
				    selectOnFocus:true,
					mode: 'local'
				});
				
				isProductionGoodsDepartureCombo = new Ext.form.ComboBox({
					fieldLabel: '&nbsp;&nbsp;&nbsp;&nbsp;'+ fcMessage.get('ui.francecustomer.goodspayment'),
					id: 'isProductionGoodsDeparture',
					name: 'isProductionGoodsDeparture',
					allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
					editable: false,
				    store: ctYesnoStore,
					valueField: 'code',
				    displayField:'description',
				    triggerAction: 'all',
				    emptyText: message.get('message.combo.pleaseselect'),
				    selectOnFocus:true,
					mode: 'local'
				});
				
				isProductionLcPaymentCombo = new Ext.form.ComboBox({
					fieldLabel: '&nbsp;&nbsp;&nbsp;&nbsp;'+ fcMessage.get('ui.francecustomer.paymentlc'),
					id: 'isProductionLcPayment',
					name: 'isProductionLcPayment',
					allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
					editable: false,
				    store: ctYesnoStore,
					valueField: 'code',
				    displayField:'description',
				    triggerAction: 'all',
				    emptyText: message.get('message.combo.pleaseselect'),
				    selectOnFocus:true,
					mode: 'local'
				});
				
				isProductionDiscountCombo = new Ext.form.ComboBox({
					fieldLabel: '&nbsp;&nbsp;&nbsp;&nbsp;'+ fcMessage.get('ui.francecustomer.discount'),
					id: 'isProductionDiscount',
					name: 'isProductionDiscount',
					allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
					editable: false,
				    store: ctYesnoStore,
					valueField: 'code',
				    displayField:'description',
				    triggerAction: 'all',
				    emptyText: message.get('message.combo.pleaseselect'),
				    selectOnFocus:true,
					mode: 'local'
				});
                
                var idValue = getPrarmeterValue(window.location, 'id');
                var startPage = getPrarmeterValue(window.location, 'startPage');
                var messageForm = new Ext.FormPanel({
                    labelAlign: 'left',
                    labelWidth: 120, 
                    url: '../../servlet/BiFranceCustomerServlet?action=1',
                    frame: true,
                    reader: new Ext.data.XmlReader({
                        record: 'item'
                    }, [{
                        name: 'id',
                        mapping: 'id'
                    }, {
                        name: 'name',
                        mapping: 'name'
                    }, {
                        name: 'department',
                        mapping: 'department'
                    }, {
                        name: 'contactRehearsals',
                        mapping: 'contactRehearsals'
                    }, {
                        name: 'rehearsalsPhone',
                        mapping: 'rehearsalsPhone'
                    }, {
                        name: 'rehearsalsFax',
                        mapping: 'rehearsalsFax'
                    }, {
                        name: 'rehearsalsEmail',
                        mapping: 'rehearsalsEmail'
                    }, {
                        name: 'rehearsalsMobile',
                        mapping: 'rehearsalsMobile'
                    }, {
                        name: 'contactPurchases',
                        mapping: 'contactPurchases'
                    }, {
                        name: 'purchasesPhone',
                        mapping: 'purchasesPhone'
                    }, {
                        name: 'purchasesFax',
                        mapping: 'purchasesFax'
                    }, {
                        name: 'purchasesEmail',
                        mapping: 'purchasesEmail'
                    }, {
                        name: 'purchasesMobile',
                        mapping: 'purchasesMobile'
                    }, {
                        name: 'contactSupplies',
                        mapping: 'contactSupplies'
                    }, {
                        name: 'suppliesPhone',
                        mapping: 'suppliesPhone'
                    }, {
                        name: 'suppliesFax',
                        mapping: 'suppliesFax'
                    }, {
                        name: 'suppliesEmail',
                        mapping: 'suppliesEmail'
                    }, {
                        name: 'suppliesMobile',
                        mapping: 'suppliesMobile'
                    }, {
                        name: 'contactLogistics',
                        mapping: 'contactLogistics'
                    }, {
                        name: 'logisticsPhone',
                        mapping: 'logisticsPhone'
                    }, {
                        name: 'logisticsFax',
                        mapping: 'logisticsFax'
                    }, {
                        name: 'logisticsEmail',
                        mapping: 'logisticsEmail'
                    }, {
                        name: 'logisticsMobile',
                        mapping: 'logisticsMobile'
                    }, {
                        name: 'contactQuality',
                        mapping: 'contactQuality'
                    }, {
                        name: 'qualityPhone',
                        mapping: 'qualityPhone'
                    }, {
                        name: 'qualityFax',
                        mapping: 'qualityFax'
                    }, {
                        name: 'qualityEmail',
                        mapping: 'qualityEmail'
                    }, {
                        name: 'qualityMobile',
                        mapping: 'qualityMobile'
                    }, {
                        name: 'contactInvoice',
                        mapping: 'contactInvoice'
                    }, {
                        name: 'invoicePhone',
                        mapping: 'invoicePhone'
                    }, {
                        name: 'invoiceFax',
                        mapping: 'invoiceFax'
                    }, {
                        name: 'invoiceEmail',
                        mapping: 'invoiceEmail'
                    }, {
                        name: 'invoiceMobile',
                        mapping: 'invoiceMobile'
                    }, {
                        name: 'addressBill',
                        mapping: 'addressBill'
                    }, {
                        name: 'addressDelivery',
                        mapping: 'addressDelivery'
                    }, {
                        name: 'addressRehearsals',
                        mapping: 'addressRehearsals'
                    }, {
                        name: 'addressProduct',
                        mapping: 'addressProduct'
                    }, {
                        name: 'addressProduct',
                        mapping: 'addressProduct'
                    }, {
                        name: 'isPrDiscount',
                        mapping: 'isPrDiscount'
                    }, {
                        name: 'prDiscount',
                        mapping: 'prDiscount'
                    }, {
                        name: 'isProductionAdvancePayment',
                        mapping: 'isProductionAdvancePayment'
                    }, {
                        name: 'productionAdvancePayment',
                        mapping: 'productionAdvancePayment'
                    }, {
                        name: 'isProductionGoodsDeparture',
                        mapping: 'isProductionGoodsDeparture'
                    }, {
                        name: 'productionGoodsDeparture',
                        mapping: 'productionGoodsDeparture'
                    }, {
                        name: 'isProductionLcPayment',
                        mapping: 'isProductionLcPayment'
                    }, {
                        name: 'productionLcPayment',
                        mapping: 'productionLcPayment'
                    }, {
                        name: 'isProductionDiscount',
                        mapping: 'isProductionDiscount'
                    }, {
                        name: 'productionDiscount',
                        mapping: 'productionDiscount'
                    }, {
                        name: 'remark',
                        mapping: 'remark'
                    }]),
                    title: fcMessage.get('ui.francecustomer.edittitle'),
                    bodyStyle: 'padding:5px 5px 5px 5px',
                    
                    items: [{
                        id: 'franceCustomerId',
                        name: 'id',
                        xtype: 'hidden'
                    },{
						xtype: 'fieldset',
						collapsible: true,
						title: fcMessage.get('ui.francecustomer.name'),
						autoHeight: true,
						items: [{
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'name',
                                    name: 'name',
                                    fieldLabel: fcMessage.get('ui.francecustomer.name'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    allowBlank: false,
                                    blankText: message.get('message.edit.noblank'),
                                    maxLength: 64
                                }]
							
							},{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'department',
                                    name: 'department',
                                    fieldLabel: fcMessage.get('ui.francecustomer.department'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							}]
						}]
					},{
						xtype: 'fieldset',
						collapsible: true,
						collapsed: true,
						title: fcMessage.get('ui.francecustomer.contactrehearsals'),
						autoHeight: true,
						items: [{
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'rehearsalsContact',
                                    name: 'contactRehearsals',
                                    fieldLabel: fcMessage.get('ui.francecustomer.contactrehearsals'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'rehearsalsPhone',
                                    name: 'rehearsalsPhone',
                                    fieldLabel: message.get('message.edit.phone'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'rehearsalsEmail',
                                    name: 'rehearsalsEmail',
                                    fieldLabel: message.get('message.edit.email'),
                                    xtype: 'textfield',
									vtype: 'email',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							},{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'rehearsalsFax',
                                    name: 'rehearsalsFax',
                                    fieldLabel: message.get('message.edit.fax'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'rehearsalsMobile',
                                    name: 'rehearsalsMobile',
                                    fieldLabel: message.get('message.edit.mobile'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							}]
						}]
					},{
						xtype: 'fieldset',
						collapsible: true,
						collapsed: true,
						title: fcMessage.get('ui.francecustomer.contactsupplies'),
						autoHeight: true,
						items: [{
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'suppliesContact',
                                    name: 'contactSupplies',
                                    fieldLabel: fcMessage.get('ui.francecustomer.contactsupplies') + '<img src="../../images/icons/paste_plain.png" style="cursor: hand;" onclick="copyContact(\'supplies\');">',
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'suppliesPhone',
                                    name: 'suppliesPhone',
                                    fieldLabel: message.get('message.edit.phone'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'suppliesEmail',
                                    name: 'suppliesEmail',
                                    fieldLabel: message.get('message.edit.email'),
                                    xtype: 'textfield',
									vtype: 'email',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							},{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'suppliesFax',
                                    name: 'suppliesFax',
                                    fieldLabel: message.get('message.edit.fax'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'suppliesMobile',
                                    name: 'suppliesMobile',
                                    fieldLabel: message.get('message.edit.mobile'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							}]
						}]
					},{
						xtype: 'fieldset',
						collapsible: true,
						collapsed: true,
						title: fcMessage.get('ui.francecustomer.contactquality'),
						autoHeight: true,
						items: [{
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'qualityContact',
                                    name: 'contactQuality',
                                    fieldLabel: fcMessage.get('ui.francecustomer.contactquality') + '<img src="../../images/icons/paste_plain.png" style="cursor: hand;" onclick="copyContact(\'quality\');">',
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'qualityPhone',
                                    name: 'qualityPhone',
                                    fieldLabel: message.get('message.edit.phone'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'qualityEmail',
                                    name: 'qualityEmail',
                                    fieldLabel: message.get('message.edit.email'),
                                    xtype: 'textfield',
									vtype: 'email',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							},{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'qualityFax',
                                    name: 'qualityFax',
                                    fieldLabel: message.get('message.edit.fax'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'qualityMobile',
                                    name: 'qualityMobile',
                                    fieldLabel: message.get('message.edit.mobile'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							}]
						}]
					},{
						xtype: 'fieldset',
						collapsible: true,
						collapsed: true,
						title: fcMessage.get('ui.francecustomer.contactpurchases'),
						autoHeight: true,
						items: [{
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'purchasesContact',
                                    name: 'contactPurchases',
                                    fieldLabel: fcMessage.get('ui.francecustomer.contactpurchases') + '<img src="../../images/icons/paste_plain.png" style="cursor: hand;" onclick="copyContact(\'purchases\');">',
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'purchasesPhone',
                                    name: 'purchasesPhone',
                                    fieldLabel: message.get('message.edit.phone'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'purchasesEmail',
                                    name: 'purchasesEmail',
                                    fieldLabel: message.get('message.edit.email'),
                                    xtype: 'textfield',
									vtype: 'email',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							},{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'purchasesFax',
                                    name: 'purchasesFax',
                                    fieldLabel: message.get('message.edit.fax'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'purchasesMobile',
                                    name: 'purchasesMobile',
                                    fieldLabel: message.get('message.edit.mobile'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							}]
						}]
					},{
						xtype: 'fieldset',
						collapsible: true,
						collapsed: true,
						title: fcMessage.get('ui.francecustomer.contactlogistics'),
						autoHeight: true,
						items: [{
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'logisticsContact',
                                    name: 'contactLogistics',
                                    fieldLabel: fcMessage.get('ui.francecustomer.contactlogistics') + '<img src="../../images/icons/paste_plain.png" style="cursor: hand;" onclick="copyContact(\'logistics\');">',
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'logisticsPhone',
                                    name: 'logisticsPhone',
                                    fieldLabel: message.get('message.edit.phone'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'logisticsEmail',
                                    name: 'logisticsEmail',
                                    fieldLabel: message.get('message.edit.email'),
                                    xtype: 'textfield',
									vtype: 'email',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							},{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'logisticsFax',
                                    name: 'logisticsFax',
                                    fieldLabel: message.get('message.edit.fax'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'logisticsMobile',
                                    name: 'logisticsMobile',
                                    fieldLabel: message.get('message.edit.mobile'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							}]
						}]
					},{
						xtype: 'fieldset',
						collapsible: true,
						collapsed: true,
						title: fcMessage.get('ui.francecustomer.contactfinance'),
						autoHeight: true,
						items: [{
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'invoiceContact',
                                    name: 'contactInvoice',
                                    fieldLabel: fcMessage.get('ui.francecustomer.contactfinance') + '<img src="../../images/icons/paste_plain.png" style="cursor: hand;" onclick="copyContact(\'invoice\');">',
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'invoicePhone',
                                    name: 'invoicePhone',
                                    fieldLabel: message.get('message.edit.phone'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'invoiceEmail',
                                    name: 'invoiceEmail',
                                    fieldLabel: message.get('message.edit.email'),
                                    xtype: 'textfield',
									vtype: 'email',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							},{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'invoiceFax',
                                    name: 'invoiceFax',
                                    fieldLabel: message.get('message.edit.fax'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                },{
									id: 'invoiceMobile',
                                    name: 'invoiceMobile',
                                    fieldLabel: message.get('message.edit.mobile'),
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 64
                                }]
							
							}]
						}]
					},{
						xtype: 'fieldset',
						collapsible: true,
						collapsed: true,
						title: fcMessage.get('ui.francecustomer.address'),
						autoHeight: true,
						items: [{
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									id: 'addressBill',
                                    name: 'addressBill',
                                    fieldLabel: fcMessage.get('ui.francecustomer.addressbill'),
                                    xtype: 'textarea',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 256
                                },{
									id: 'addressRehearsals',
                                    name: 'addressRehearsals',
                                    fieldLabel: fcMessage.get('ui.francecustomer.addressrehearsals') + '<img src="../../images/icons/paste_plain.png" style="cursor: hand;" onclick="copyValue(\'addressBill\', \'addressRehearsals\');">',
                                    xtype: 'textarea',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 256
                                }]
							
							},{
                                columnWidth: .5,
                                layout: 'form',
                                items: [
//								{
//									id: 'addressDelivery',
//                                    name: 'addressDelivery',
//                                    fieldLabel: fcMessage.get('ui.francecustomer.addressdelivery'),
//                                    xtype: 'textfield',
//                                    anchor: '86%',
//									width: '90%',
//                                    maxLength: 256
//                                },
								{
									id: 'addressProduct',
                                    name: 'addressProduct',
                                    fieldLabel: fcMessage.get('ui.francecustomer.addressproduct') + '<img src="../../images/icons/paste_plain.png" style="cursor: hand;" onclick="copyValue(\'addressBill\', \'addressProduct\');">',
                                    xtype: 'textarea',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 256
                                }]
							
							}]
						}]
					},{
						xtype: 'fieldset',
						collapsible: true,
						collapsed: false,						
						title: fcMessage.get('ui.francecustomer.payment'),
						autoHeight: true,
						items: [{
                            layout: 'column',
                            items: [{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									html: '<div class="div"><label class="x-form-item-label"><b>' + fcMessage.get('ui.francecustomer.er') + '&nbsp;&nbsp;&nbsp;&nbsp;' + fcMessage.get('ui.francecustomer.cashtt') + '</b></label></div>'
                                },isPrDiscountCombo,{
									html: '<div class="div"><label class="x-form-item-label"><b>' + fcMessage.get('ui.francecustomer.product') + '</b></label></div>'
                                },isProductionAdvancePaymentCombo,
								isProductionGoodsDepartureCombo,
								isProductionLcPaymentCombo,
								isProductionDiscountCombo]
							
							},{
                                columnWidth: .5,
                                layout: 'form',
                                items: [{
									html: '<div class="div"><label class="x-form-item-label">&nbsp;</label></div>'
                                },{
									id: 'prDiscount',
                                    name: 'prDiscount',
                                    fieldLabel: '%',
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 256
                                },{
									html: '<div class="div"><label class="x-form-item-label">&nbsp;</label></div>'
                                },{
									id: 'productionAdvancePayment',
                                    name: 'productionAdvancePayment',
                                    fieldLabel: '%',
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 256
                                },{
									id: 'productionGoodsDeparture',
                                    name: 'productionGoodsDeparture',
                                    fieldLabel: '%',
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 256
                                },{
									id: 'productionLcPayment',
                                    name: 'productionLcPayment',
                                    fieldLabel: '%',
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 256
                                },{
									id: 'productionDiscount',
                                    name: 'productionDiscount',
                                    fieldLabel: '%',
                                    xtype: 'textfield',
                                    anchor: '86%',
									width: '90%',
                                    maxLength: 256
                                }]
							
							}]
						}]
					}, {
                        fieldLabel: fcMessage.get('ui.francecustomer.remark'),
                        name: 'remark',
                        allowBlank: true,
                        xtype: 'textarea',
                        blankText: message.get('message.edit.noblank'),
                        maxLength: 512,
						width: '90%',
                        maxLengthText: message.get('message.edit.toolong')
                    }],
                    
                    buttons: [{
                        text: message.get('message.edit.save'),
                        handler: function(){
                            if (messageForm.getForm().isValid()) {
								document.getElementsByName('isPrDiscount')[0].value = isPrDiscountCombo.getValue();
								document.getElementsByName('isProductionAdvancePayment')[0].value = isProductionAdvancePaymentCombo.getValue();
								document.getElementsByName('isProductionGoodsDeparture')[0].value = isProductionGoodsDepartureCombo.getValue();
								document.getElementsByName('isProductionLcPayment')[0].value = isProductionLcPaymentCombo.getValue();
								document.getElementsByName('isProductionDiscount')[0].value = isProductionDiscountCombo.getValue();
                                //messageForm.hide();
                                messageForm.getForm().submit({
                                    method: 'post',
                                    success: function(form, action){
                                        //alert(form);
										
                                        messageTip.msg(message.get('message.tip'), message.get('message.edit.successful'));
                                        messageForm.getForm().reset();
                                        //messageForm.show();
                                    },
                                    failure: function(form, action){
                                        //alert(form);
                                        messageTip.msg(message.get('message.tip'), message.get('message.edit.unsuccessful'));
                                        //messageForm.show();
                                    }
                                });
                            }
                        }
                    },{
						text: message.get('message.edit.reset'),
						handler: function(){
							messageForm.getForm().reset();
						}
					}, {
                        text: message.get('message.edit.cancel'),
                        handler: function(){
                            if (startPage != null) {
                                window.location = 'france_customer_list.html?startPage=' + startPage;
                            }
                            else {
                                window.location = 'france_customer_list.html';
                            }
                        }
                    }]
                });
				
				messageForm.render('franceCustomer');
	
		
				if(idValue != null){
					document.getElementById('franceCustomerId').value = idValue;
					messageForm.getForm().load({url:'../../servlet/BiFranceCustomerServlet?action=3&id=' + idValue, waitMsg:Ext.LoadMask.prototype.msg});
				}
            });
			
			
        </script>
    </head>
    <body>
        <div id="franceCustomer"></div>
    </body>
</html>
